package com.lmx.repoDomain.tmodel;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ForeignKey;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
//huibati

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import io.katharsis.resource.annotations.JsonApiIncludeByDefault;
import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;

/**
 * 违规记录表
 */
@Entity
@Table(name = "tnb_record_violation")
@JsonApiResource(type = "recordViolation")
public class RecordViolation extends BaseEntity {
	private Customer customer;// 老人信息
	private Dicttype type;//业务类型ID 参考c_tnb_recordViolationType
	private String setTime;// 规定时间
	private Integer exeTime;// 执行时间
	private String status;// 记录状态 1 提前，2未执行，3超时
	private Integer createTime;// 创建时间
	private String createDate;// 创建日期
	private Employee employee;// 执行人
	private NursingPlanDetail nursingPlanDetail;

	private CustomerDrugProject customerDrugProject;

	private HbeaconWarning hbeaconWarning;

	private Integer callTime;
	
	private String remark;

	@Column(name = "callTime")
	public Integer getCallTime() {
		return callTime;
	}

	public void setCallTime(Integer callTime) {
		this.callTime = callTime;
	}
	
	@Column(name = "setTime")
	public String getSetTime() {
		return setTime;
	}

	public void setSetTime(String setTime) {
		this.setTime = setTime;
	}

	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "create_time")
	public Integer getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Integer createTime) {
		this.createTime = createTime;
	}

	@Column(name = "create_date")
	public String getCreateDate() {
		return createDate;
	}

	public void setCreateDate(String createDate) {
		this.createDate = createDate;
	}

	@Column(name = "status")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "exeTime")
	public Integer getExeTime() {
		return exeTime;
	}

	public void setExeTime(Integer exeTime) {
		this.exeTime = exeTime;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "customer_id",foreignKey = @ForeignKey(name = "null"))
	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "employee_id",foreignKey = @ForeignKey(name = "null"))
	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "nursingplan_detail_id",foreignKey = @ForeignKey(name = "null"))
	public NursingPlanDetail getNursingPlanDetail() {
		return nursingPlanDetail;
	}

	public void setNursingPlanDetail(NursingPlanDetail nursingPlanDetail) {
		this.nursingPlanDetail = nursingPlanDetail;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.JOIN)
	@JoinColumn(name = "drug_project_id",foreignKey = @ForeignKey(name = "null"))
	public CustomerDrugProject getCustomerDrugProject() {
		return customerDrugProject;
	}

	public void setCustomerDrugProject(CustomerDrugProject customerDrugProject) {
		this.customerDrugProject = customerDrugProject;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.JOIN)
	@JoinColumn(name = "hbeaconwarning_id",foreignKey = @ForeignKey(name = "null"))
	public HbeaconWarning getHbeaconWarning() {
		return hbeaconWarning;
	}

	public void setHbeaconWarning(HbeaconWarning hbeaconWarning) {
		this.hbeaconWarning = hbeaconWarning;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.JOIN)
	@JoinColumn(name = "type_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getType() {
		return type;
	}

	public void setType(Dicttype type) {
		this.type = type;
	}
}
